let player = new Audio();
// 播放歌曲
player.playSong = function(url){
    if(url){
        this.src = url;
    }
    this.play();
    
}
player.addEventListener("play",function(){
    this.vm.$store.commit("changePlayerState","play");
})
player.addEventListener("pause",function(){
    this.vm.$store.commit("changePlayerState","pause");
})
player.addEventListener("error",function(){
    this.vm.$store.commit("changePlayerState","error");
})
player.addEventListener("timeupdate",function(){
    var currentTime = this.currentTime;     // 当前时间
    var duration = this.duration;           // 时长
    this.vm.$store.commit("timeupdate",{currentTime,duration});
})

export default player;